package com.financing.wap.web.controller.api;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.financing.wap.common.ResultMap;
import com.financing.wap.common.ResultMap.STATUS;
import com.financing.wap.common.Session;
import com.financing.wap.common.SessionUtil;
import com.financing.wap.dto.HybxOrderDTO;
import com.financing.wap.dto.UserDTO;
import com.financing.wap.service.ISmsService;
import com.financing.wap.web.controller.BaseController;

/**
 * 机构信息API
 * @author jtl
 *
 */
@Controller("hybxOrderController")
@RequestMapping("/api/order")
public class HybxOrderController extends BaseController {
	Logger logger = Logger.getLogger(getClass());

	
	@Autowired
	private ISmsService smsServiceImpl;

	/**
	 * 
	 * @param dto
	 * @param validationResult
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("addHybxOrder")
	@ResponseBody
	public ResultMap addCorpFa(HybxOrderDTO dto,HttpServletRequest request, HttpServletResponse response){
		ResultMap result = new ResultMap();
		try{
			Session session = SessionUtil.getSession();
			UserDTO loginUser = session.getUser();
			dohwbxOrder(dto, request, result, loginUser);
		}catch(Exception e) {
			logger.error("addHybxOrder error",e);
			result.setStatus(STATUS.ERROR);
			result.setStatusCode(ResultMap.STATUS_CODE_SYS_EXCEPTION);
		}
		return result;
	}


}
